# coding: utf-8

"""
@version: python3.6
@author: 噢啦嘿嘿
@contact: jian.zhou@360che.com
@software: PyCharm
@file: init_data.py
@time: 2021/3/16 17:31
"""

from lib.read_data import data
from lib.loggers import log
import os
import pytest

BASE_PATH = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))


def get_data(file_name):

    data_file_path = os.path.join(BASE_PATH, "data", file_name)
    if '.yml' in file_name:
        test_data = data.load_yaml(data_file_path)
    if '.json' in file_name:
        test_data = data.load_json(data_file_path)
    if '.ini' in file_name:
        test_data = data.load_ini(data_file_path)

    return test_data


